import time
from typing import List, Dict
import random

class Guest:
    def __init__(self):
        pass

    def collect_intermediates(self, hosts: List[str], n: int, timeout: int) -> Dict[str, List[float]]:
        """
        Collects intermediate results from hosts with a timeout and backup worker.
        """
        results = {}
        for host in hosts:
            try:
                # Simulate network delay
                delay = random.uniform(0, timeout / 2)
                time.sleep(delay)
                # Simulate intermediate result collection
                results[host] = [random.random() for _ in range(n)]
            except Exception as e:
                print(f"Error collecting from {host}: {e}")
        return results